import axios from "axios"
import store from "@/store"
let instance = axios.create({
    baseURL: 'http://sell.h5.itsource.cn:8087',
    timeout: 10000,
})

instance.interceptors.request.use(config => {
    let token = store.state.user.token
    token && (config.headers.authorization = token)
    return config
}, err => {
    return Promise.reject(err)
})

instance.interceptors.response.use(response => {
    return response
}, err => {
    return Promise.reject(err)
})


export default instance